<?php
namespace module\app\controller;

use app\Controller;
use app\model\Adv;
use app\model\Activity;
use app\model\Pay;
use app\model\UserNotice;

class Index extends Controller
{
    public function index()
    {
        $advs = Adv::where('status', 2)->select()->toArray();
        $now = time();
        return json([
            'advs' => $advs,
            'notices' => UserNotice::field(['title', 'content'])->where([['status', '=', 2], ['start_at', '<', $now], ['end_at', '>', $now]])->select()->toArray()
        ]);
    }
    /**
     * Undocumented function
     *
     * @return void
     */
    public function start(){
        return json([
            'cover' => '123.gif',
            'slogin' => '11111111111111111111111'
        ]);
    }
    /**
     * Undocumented function
     *
     * @return void
     */
    public function info(){
        return json(app('http')->getName());
    }
}
